Avoid division by 0 in the border rendering code
authorMatthias Clasen <mclasen@redhat.com>
Sat, 9 Jan 2016 22:30:33 +0000 (17:30 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 10 Jan 2016 04:44:43 +0000 (23:44 -0500)
We skip sides with 0 border width in render_border, but when
we collect sides with the same style, we may pass the 0 width
down to render_frame_stroke anyway. So skip width 0 sides
there as well.

gtk/gtkrenderborder.c

index 22452d15cb377778b0e3a8eab6310e622c5b9e87..84f81428cfc906dfbd110b48b24d9680d37207f6 100644 (file)
@@ -518,11 +518,14 @@ render_frame_stroke (cairo_t       *cr,
                                border_width[GTK_CSS_BOTTOM],
                                border_width[GTK_CSS_LEFT]);
 
-      for (i = 0; i < 4; i++) 
+      for (i = 0; i < 4; i++)
         {
           if (hidden_side & (1 << i))
             continue;
 
+          if (border_width[i] == 0)
+            continue;
+
           cairo_save (cr);
 
           if (i == 0)